package com.gigi.model;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.*;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import org.apache.poi.ss.usermodel.BorderStyle;
import org.apache.poi.ss.usermodel.FillPatternType;
import org.apache.poi.ss.usermodel.HorizontalAlignment;

import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

@ApiModel("签到实体")
@Data
@ContentRowHeight(30)  // 设置内容行高
@HeadRowHeight(30) // 设置头行高
@ColumnWidth(32) // 设置列宽
@ContentFontStyle(fontHeightInPoints = 18, color = 9, bold = true) // 设置内容字体样式
@HeadFontStyle(fontHeightInPoints = 18, color = 9, fontName = "Calibri") // 设置头字体样式
@ContentStyle(horizontalAlignment = HorizontalAlignment.LEFT, fillPatternType = FillPatternType.SOLID_FOREGROUND, fillForegroundColor = 30
        , borderBottom = BorderStyle.NONE, borderTop = BorderStyle.NONE, borderLeft = BorderStyle.NONE, borderRight = BorderStyle.NONE)
// 设置内容对其方式，背景颜色
@HeadStyle(horizontalAlignment = HorizontalAlignment.LEFT, fillPatternType = FillPatternType.SOLID_FOREGROUND, fillForegroundColor = 30
        , borderBottom = BorderStyle.NONE, borderTop = BorderStyle.NONE, borderLeft = BorderStyle.NONE, borderRight = BorderStyle.NONE)
// 设置头对其方式，背景颜色
public class SignInDO {

    @ExcelIgnore
    private Long id;

    // 发布人
    @ExcelIgnore
    @NotNull(message = "用户id不能为空")
    private Long userId;

    @ExcelIgnore
    @NotNull(message = "课程id不能为空")
    private Long courseId;

    @ExcelIgnore
    @NotNull(message = "类型不能为空")
    private Integer type;

    @ExcelProperty(value = "签到方式", index = 6)
    private String typeDesc;

    @ExcelIgnore
    private String location;

    @ExcelIgnore
    private String locationRange;

    @ExcelIgnore
    private Long pwd;

    @ExcelIgnore
    private Integer state;

    @ExcelProperty(value = "课程", index = 0)
    private String courseName;

    @ExcelProperty(value = "发起教师", index = 2)
    private String teacherName;

    @ExcelProperty(value = "工号", index = 3)
    private Long teacherNo;

    @ExcelProperty(value = "班级", index = 1)
    private String className;

    @ExcelIgnore
    private String classesIdStr;

    @ExcelProperty(value = "发起时间", index = 4)
    private String startTimeStr;

    @ExcelIgnore
    private LocalDateTime startTime;

    @ExcelProperty(value = "截止时间", index = 5)
    private String endTimeStr;

    @ExcelIgnore
    private LocalDateTime endTime;

}
